package com.gaojice.server.http.service;

import java.io.IOException;
import java.net.Socket;
import java.net.URISyntaxException;

import com.gaojice.server.http.model.Request;
import com.gaojice.server.http.model.Response;

public class RequestHandler {
	private ResponseService responseService = new ResponseService();
	private RequestService requestService = new RequestService();

	public void handRequest(Socket socket) throws IOException,
			URISyntaxException {
		Request request = requestService.getRequestFromSocket(socket);
		System.out.println(request.getHeader());
		Response response = responseService.getResponse(request);
		responseService.response(response, socket);
	}
}
